<?php

namespace Application\Model;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterInterface;

class Commande  implements InputFilterAwareInterface{
	
	protected $inputFilter;
	
	public function exchangeArray($data){
		$this->type_commande        = (isset($data['type_commande'])) ? $data['type_commande'] : null;
		$this->message        = (isset($data['message'])) ? $data['message'] : null;
		
	}
	
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}
	
	public function setInputFilter(InputFilterInterface $inputFilter)
	{
		throw new \Exception("Not used");
	}
	
	public function getInputFilter(){
		
		if(!$this->inputFilter){
	
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();
	
			$inputFilter->add($factory->createInput(array(
					'name'     => 'type_commande',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					)
					)));
	
			$inputFilter->add($factory->createInput(array(
					'name'     => 'message',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					)
			)));
			
	
			$this->inputFilter = $inputFilter;
		}
	
		return $this->inputFilter;
	}
}

?>